/**
 * 
 */
package cn.edu.cqupt.cyExam.service;

import java.util.List;

import javax.annotation.Resource;

import cn.edu.cqupt.cyExam.myBatis.bean.Graduateq;
import org.springframework.stereotype.Service;

import cn.edu.cqupt.cyExam.myBatis.bean.User;
import cn.edu.cqupt.cyExam.myBatis.dao.GraduateqMapper;
import cn.edu.cqupt.cyExam.myBatis.dao.NewmemberqMapper;
import cn.edu.cqupt.cyExam.myBatis.dao.SocialqMapper;
import cn.edu.cqupt.cyExam.myBatis.dao.TypeMapper;
import cn.edu.cqupt.cyExam.myBatis.dao.UserMapper;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author asus
 *
 */
@Service("questionService")
public class QuestionService {
	@Resource
	private GraduateqMapper graduateqMapper;

	@Resource
	private NewmemberqMapper newmemberqMapper;
	@Resource
	private SocialqMapper socialqMapper;
	@Resource
	private TypeMapper typeMapper;
	@Resource
	private UserMapper userMapper;

	public List<User> getUser() {
		return userMapper.selectall();

	}

	public List<Graduateq> queryGraduateq(
			@RequestParam(value = "type_name", required = false) String type_name,
			@RequestParam(value = "kind", required = false) String kind) {

		Integer type_Id =(Integer) typeMapper.queryTypeIdByTypeName(type_name);


		return graduateqMapper.queryGraduateq((Integer) type_Id, (String) kind);

	}

	public int deleteGraduateq(String graduate_name){
	    return graduateqMapper.delectGraduate(graduate_name);
    }
    public List<Graduateq> getGraduateqByname(String graduate_name){
		return graduateqMapper.selectGraduateByname(graduate_name);
	}
	public Graduateq getGraduateqByid(Integer graduate_id){
		return graduateqMapper.selectGraduateByid(graduate_id);
	}
}
